package cn.hfjava.kz.entity.po;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 用户表
 * @TableName users
 */
@TableName(value ="users")
@Getter
@Setter
@ToString
public class User implements Serializable {
    /**
     * 用户编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 昵称
     */
    @TableField(value = "nickname")
    private String nickname;

    /**
     * 头像
     */
    @TableField(value = "avatar")
    private String avatar;

    /**
     * 手机号
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 用户唯一标识
     */
    @TableField(value = "openid")
    private String openid;

    /**
     * 创建时间
     */
    @TableField(value = "createdDate")
    //@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdDate;

    /**
     * 用户状态 0启用 1禁用
     */
    @TableField(value = "status")
    private Integer status;


    /**
     * 角色编号
     */
    @TableField(value = "roleId")
    private Integer roleId;

    /**
     * 逻辑删除 0存在 1删除
     */
    @TableLogic
    @TableField(value = "deleted")
    private Integer deleted;

    @TableField(exist = false)
    private Role userRole;

    @TableField(exist = false)
    private List<String> permissionList;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    @TableField(exist = false)
    private String tokenValue;


    @TableField(exist = false)
    private String tokenName;

}